﻿using Raffles.OA.Data;
using Raffles.OA.Utility;
using SqlSugar;
using System.Collections.Generic;

namespace Raffles.OA.WebApp
{
    /// <summary>
    /// 全局加载配置缓存
    /// </summary>
    public class CacheConfig
    {
        public static SqlSugarScope _dbContext = ReportDB.Db;
        public static void RegisterGlobalCache()
        {
            List<Config> configList = _dbContext.Queryable<Config>().Where(x => !x.DeletedMark && x.EnabledMark).ToList();
            foreach (Config config in configList)
            {
                CacheHelper.SetCache(config.Code, config.Value);
            }
        }
    }
}